package com.bdqn.controller;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
@Controller
public class AddController {
    @RequestMapping(value = "/hellotwo")
    public String hello1(){
        System.out.println("hellotwo");
        return "hellotwo";
    }
    @RequestMapping("/showtwo")
    public String submitAccount(
            @RequestParam("account") String account,
            @RequestParam("username") String username,
            @RequestParam("email") String email,
            @RequestParam("age") int age,
            Model model) {
        // 将四个参数添加到 Model 中
        model.addAttribute("account", account);
        model.addAttribute("username", username);
        model.addAttribute("email", email);
        model.addAttribute("age", age);
        // 返回 showtwo.jsp 页面的逻辑视图名
        return "showtwo";
    }
}
